<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<p:dialog widgetVar="dlgCotacaoFornecedores" modal="true"
	header="#{message.header_cotacao_fornecedor}">
	<h:form id="formOrcaForn">
		<p:outputPanel style="width:950px;">
			<p:dataTable value="#{listaOrcamentoTela.listaFornecedores}"
				var="fornecedor" emptyMessage="#{message.table_empty}"
				style="margin-top:20px; width:950px;" paginator="true" rows="5">

				<p:column style="width:4%">
					<p:rowToggler />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{message.label_razao}" />
					</f:facet>
					<h:outputText value="#{fornecedor.nome}" />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{message.label_cnpj}" />
					</f:facet>
					<h:outputText value="#{fornecedor.cnpj}">
					</h:outputText>
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{message.label_email}" />
					</f:facet>
					<h:outputText value="#{fornecedor.email}">
					</h:outputText>
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{message.label_fone}" />
					</f:facet>
					<h:outputText value="#{fornecedor.fone}">
					</h:outputText>
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{message.label_contato}" />
					</f:facet>
					<h:outputText value="#{fornecedor.contato}">
					</h:outputText>
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{message.label_valor_total}" />
					</f:facet>
					<h:outputText value="#{fornecedor.valorTotal}">
					</h:outputText>
				</p:column>

				<p:column>
					<p:commandButton icon="ui-icon-check" update="@form,:messages"
						action="#{listaOrcamentoTela.aprovaCotacoesFornecedor(fornecedor.listaCotacao)}" />
				</p:column>

				<p:rowExpansion>

					<p:dataTable value="#{fornecedor.listaCotacao}" var="cotacao"
						emptyMessage="#{message.table_empty}"
						style="margin-left:-400px; margin-top:20px; margin-bottom:10px; width:800px; left: 50%;	position: relative;">

						<p:column>
							<f:facet name="header">
								<h:outputText value="#{message.label_codigo}" />
							</f:facet>
							<h:outputText value="#{cotacao.itemOrcamento.produto.codigo}" />
						</p:column>

						<p:column>
							<f:facet name="header">
								<h:outputText value="#{message.label_marca}" />
							</f:facet>
							<h:outputText value="#{cotacao.itemOrcamento.produto.marca}" />
						</p:column>

						<p:column>
							<f:facet name="header">
								<h:outputText value="#{message.label_descricao}" />
							</f:facet>
							<h:outputText value="#{cotacao.itemOrcamento.produto.descricao}" />
						</p:column>

						<p:column>
							<f:facet name="header">
								<h:outputText value="#{message.label_um}" />
							</f:facet>
							<h:outputText
								value="#{cotacao.itemOrcamento.produto.unidadeMedida}" />
						</p:column>

						<p:column>
							<f:facet name="header">
								<h:outputText value="#{message.label_quantidade}" />
							</f:facet>
							<h:outputText value="#{cotacao.itemOrcamento.quantidade}" />
						</p:column>

						<p:column>
							<f:facet name="header">
								<h:outputText value="#{message.label_valor_uni}" />
							</f:facet>
							<h:outputText value="#{cotacao.valorUnitario}" />
						</p:column>

					</p:dataTable>
				</p:rowExpansion>

			</p:dataTable>
		</p:outputPanel>
	</h:form>
</p:dialog>
</html>